#!/bin/bash 
##############################
#制作人:曹斌鑫
##############################

#备份OS中vim的配置   
function bakup_vimconfig()
{
	echo "Bakup your vimconfig file..."
	rm   -rf $HOME/.bakvim
	mkdir $HOME/.bakvim
	cp 	  $HOME/.vim  $HOME/.bakvim -a 
	cp 	  $HOME/.vimrc $HOME/.bakvim 
	cp 	  $HOME/.bashrc $HOME/.bakvim 
}

#配置vim
function config_vim()
{
	echo "Config your vim now !"
	rm -rf $HOME/.vim 
	cp ./.vim  $HOME -a 
	cp ./.vimrc $HOME 
	cp ./.bashrc $HOME

	#生成tags文件
	sudo cp ctags /bin 
	echo "Make tags in /usr/include"
	cd /usr/include
	sudo ctags -I __THROW -I __THROWNL -I __nonnull -R --c-kinds=+p --fields=+iaS --extra=+q
}

auto_install_soft(){
	echo "Auto install vim & ctags"
	sudo apt-get install vim 
	sudo apt-get install exuberant-ctags

	echo "Auto install typora !"
	wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
	sudo add-apt-repository 'deb https://typora.io/linux ./'
	sudo apt-get update
	sudo apt-get install typora

	echo "Auto install PDF okular"
	 sudo apt-get install okular

	 echo "Auto Word translation"
	 sudo apt-get install xclip
	 sudo apt-get install sdcv
	 sudo apt-get install notify-send

	 echo "Auto install terminator"
	 sudo apt-get install terminator
	 cp ./configTerminator ~/.config/terminator/config

	 echo "Auto install Screenshot"
	 sudo apt-get install pinta
	 sudo apt-get install scrot

	 echo "Auto install OCR"
	 sudo add-apt-repository ppa:alex-p/tesseract-ocr 
	 sudo apt-get update 
	 sudo apt-get install tesseract-ocr
	 sudo apt-get install gnome-screenshot 
	 sudo apt-get install xclip 
	 sudo apt-get install imagemagick
	 sudo apt install python3-pip
	 pip3 install pyperclip

 }
cp_usedSH(){
	echo "copy use sh."
	mkdir ~/.usedSH
	cp usedSh/* ~/.usedSH/
	echo "Pls config used sh ...."
}
auto_install_soft
bakup_vimconfig
config_vim
cp_usedSH
